package edu.fzu.fundmgr.service.impl;

import java.util.List;

import edu.fzu.fundmgr.dao.FundDao;
import edu.fzu.fundmgr.dao.impl.FundDaoJDBCImpl;
import edu.fzu.fundmgr.domain.Fund;
import edu.fzu.fundmgr.domain.FundHolding;
import edu.fzu.fundmgr.domain.FundTransInfo;
import edu.fzu.fundmgr.service.FundService;

public class FundServiceImpl implements FundService {

	public void addFund(Fund fund) {

		FundDao fundDao = new FundDaoJDBCImpl();
		fundDao.addFund(fund);
	}
	public List<FundHolding> loadFundHolding(){

		FundDao fundDao = new FundDaoJDBCImpl();
		return fundDao.loadFundHolding();
	}
	public List<FundTransInfo> loadFundTrans() {

		FundDao fundDao = new FundDaoJDBCImpl();
		return fundDao.loadFundTrans();
	}

	public List<Fund> loadAll() {

		FundDao fundDao = new FundDaoJDBCImpl();
		return fundDao.loadAll();
	}

	public void removeFund(Integer fundNO) {

		FundDao fundDao = new FundDaoJDBCImpl();
		fundDao.delFund(fundNO);
	}

	public Fund getFund(Integer fundNO) {

		FundDao fundDao = new FundDaoJDBCImpl();
		return fundDao.getFund(fundNO);
	}

	public void updateFund(Fund fund) {

		FundDao fundDao = new FundDaoJDBCImpl();
		fundDao.updateFund(fund);
	}

}
